<?php
class DigUser_View_Helper_DigUserAclLink extends Zend_View_Helper_HtmlElement
{
    public function digUserAclLink($label, $url, $options = array())
    {
        $user = DigUser_Service_User::current();
        if($user) {
            $role = strtolower($user->role);
        } else {
            $role = 'guest';
        }
        if(DigUser_Service_User::urlIsAllowed($role, $url)) {
            $xhtml = sprintf("<a href='%s' %s >%s</a>",
                $url,
                $this->_htmlAttribs($options),
                $label);
            return $xhtml;
        }
    }
}
?>